package com.ljj.service;

import com.ljj.dataobject.ProductInfo;
import com.ljj.dto.CartDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;


/**
 * @FileName: IProductInfoService.java
 * @Package: com.ljj.service
 * @Author: lijiajun
 * <br/>
 * @Created: 2018/3/23 10:54
 * Copyright (C), 2018, KINGDEE
 */
public interface IProductInfoService {
    ProductInfo findOne(String productId);

    /**
     * 查询所有在架商品列表
     * @return
     */
    List<ProductInfo> findUpAll();

    Page<ProductInfo> findAll(Pageable pageable);

    ProductInfo save(ProductInfo productInfo);

    //加库存
    void increaseStock(List<CartDTO> cartDTOList);

    //减库存
    void decreaseStock(List<CartDTO> cartDTOList);

    //上架
    ProductInfo onSale(String productId);

    //下架
    ProductInfo offSale(String productId);
}
